xen.git
14 years agolibxl: New event generation API
Ian Jackson [Fri, 27 Jan 2012 17:01:22 +0000 (17:01 +0000)]
libxl: New event generation API

Replace the existing API for retrieving high-level events (events
about domains, etc.) from libxl with a new one.

This changes the definition and semantics of the `libxl_event'
structure, and replaces the calls for obtaining information about
domain death and disk eject events.

This is an incompatible change, sorry.  The alternative was to try to
provide both the previous horrid API and the new one, and would also
involve never using the name `libxl_event' for the new interface.

The new "libxl_event" structure is blacklisted in the ocaml bindings
for two reasons:
  - It has a field name "type" (which is a keyword in ocaml);
    the ocaml idl generator should massage this field name on
    output, to "type_" perhaps.
  - The ocaml idl generator does not support KeyedUnion.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agoocaml, libxl: support "private" fields
Ian Jackson [Fri, 27 Jan 2012 17:01:21 +0000 (17:01 +0000)]
ocaml, libxl: support "private" fields

The changeset
  24378:b4365e2c2595  libxl: idl: support new "private" type attribute
is not complete.  Actually using this feature does not work because
the ocaml idl generator does not know about it.

So add that support.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: New API for providing OS events to libxl
Ian Jackson [Fri, 27 Jan 2012 17:01:20 +0000 (17:01 +0000)]
libxl: New API for providing OS events to libxl

We provide a new set of functions and related structures
  libxl_osevent_*
which are to be used by event-driven applications to receive
information from libxl about which fds libxl is interested in, and
what timeouts libxl is waiting for, and to pass back to libxl
information about which fds are readable/writeable etc., and which
timeouts have occurred.  Ie, low-level events.

In this patch, this new machinery is still all unused.  Callers will
appear in the next patch in the series, which introduces a new API for
applications to receive high-level events about actual domains etc.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agoxl: fix a couple of memory leaks
Ian Jackson [Fri, 27 Jan 2012 17:01:19 +0000 (17:01 +0000)]
xl: fix a couple of memory leaks

* dolog leaked the log message (!)

* main() leaked the config_data (perhaps a false positive from valgrind,
  but it's nicer to tidy it up).

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years ago.gitignore/.hgignore: New names for ioemu dirs, seabios
Ian Jackson [Fri, 27 Jan 2012 17:01:18 +0000 (17:01 +0000)]
.gitignore/.hgignore: New names for ioemu dirs, seabios

* Add new seabios clone directories to .gitignore.
* Add new qemu clone directories to .gitignore.
* Remove old tools/ioemu (long-obsolete) from .gitignore and .hgignore.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agotools: xencommons init script: Fix setting XENSTORED_ROOTDIR
Jim Fehlig [Thu, 26 Jan 2012 17:43:31 +0000 (17:43 +0000)]
tools: xencommons init script: Fix setting XENSTORED_ROOTDIR

Due to a logic bug, XENSTORED_ROOTDIR was not being set to
default value when zero length.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: fix parse_backend_path and device_backend_path to be mutual
Roger Pau Monne [Thu, 26 Jan 2012 17:38:05 +0000 (17:38 +0000)]
libxl: fix parse_backend_path and device_backend_path to be mutual

Currently if libxl__parse_backend_path is used and then you try to get
the original path again with libxl__device_backend_path the
result is wrong. This patch fixes the issue, so transformation from
path to libxl__device and back is reciprocal.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoGet rid of non-static 'inline' modifiers (gcc 4.2.1 complains)
Tim Deegan [Thu, 26 Jan 2012 15:42:40 +0000 (15:42 +0000)]
Get rid of non-static 'inline' modifiers (gcc 4.2.1 complains)

They seem to have been introduced by accident in 23311:f4585056b9ae
when some 'static inline' functions were moved out of a header

Signed-off-by: Tim Deegan <tim@xen.org>
14 years agoBring OpenBSD stdarg handling in line with FreeBSD case
Tim Deegan [Thu, 26 Jan 2012 15:35:36 +0000 (15:35 +0000)]
Bring OpenBSD stdarg handling in line with FreeBSD case

Having an absolute path in a #include confuses distcc's pump mode
so get rid ofit by using the same runes for both BSDs.

Signed-off-by: Tim Deegan <tim@xen.org>
14 years agoFix build.
Tim Deegan [Thu, 26 Jan 2012 15:05:15 +0000 (15:05 +0000)]
Fix build.

Bring xc_mem_paging.c in line with other users of munlock in libxc.
Otherwise it trips over -Werror=unused-value

Signed-off-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Avoid spurious deadlock panic trigger
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: Avoid spurious deadlock panic trigger

In the mm layer, if we take lock A, then lock B, and the recursively lock A,
the deadlock detector panics. This is not a deadlock risk because we
already 'own' the outer lock (A), so we will not contend for that resource.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: clean use of p2m unlocked queries
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: clean use of p2m unlocked queries

Limit such queries only to p2m_query types. This is more compatible
with the name and intended semantics: perform only a lookup, and explicitly
in an unlocked way.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Properly account for paged out pages
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: Properly account for paged out pages

If we hit the page after nominate but before paging it out, don't decrement the
domain count of paged out pages.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Remove stale variable from debugtrace printk in p2m audit
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: Remove stale variable from debugtrace printk in p2m audit

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Output domain count of paged pages in console
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: Output domain count of paged pages in console

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Allow foreign read-only mappings of shared pages
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: Allow foreign read-only mappings of shared pages

Because shared pages are owned by dom_cow, the ownership test
while foreign mapping fails.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Fix p2m teardown locking
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: Fix p2m teardown locking

Holding the p2m lock during a p2m teardown, while unsharing entries pointing to
shared frames, causes a locking inversion and deadlock panic.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Fix paging_load
Andres Lagar-Cavilla [Thu, 26 Jan 2012 13:21:27 +0000 (13:21 +0000)]
x86/mm: Fix paging_load

When restoring a p2m entry in the paging_load path, we were not updating the
m2p entry correctly.

Also take advantage of this to act on an old suggestion: once done with the
load, promote the p2m entry to the final guest accessible type. This simplifies
logic.

Tested to work with xenpaging.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Sharing overhaul style improvements
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: Sharing overhaul style improvements

The name 'shared_info' for the list of shared pages backed by a share frame
collided with the identifier also used for a domain's shared info page. To
avoid grep/cscope/etc aliasing, rename the shared memory token to 'sharing.

This patch only addresses style, and performs no functional changes. To ease
reviwing, the patch was left as a stand-alone last-slot addition to the queue
to avoid propagating changes throughout the whole series.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agoTools: Add a sharing command to xl for information about shared pages
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
Tools: Add a sharing command to xl for information about shared pages

Also add the global sharing statistics to the libxl physinfo.  This is a slight
departure from libxc, but there's no reason libxl physinfo can't include extra
bits of useful and relevant information.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Tim Deegan <tim@xen.org>
14 years agoTools: Expose to libxc the total number of shared frames and space saved
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
Tools: Expose to libxc the total number of shared frames and space saved

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agoUpdate memshr API and tools
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
Update memshr API and tools

This patch is the folded version of API updates, along with the associated tool
changes to ensure that the build is always consistent.

API updates:
- The source domain in the sharing calls is no longer assumed to be dom0.
- Previously, the mem sharing code would return an opaque handle to index
  shared pages (and nominees) in its global hash table.  By removing the hash
  table, the handle becomes a version, to avoid sharing a stale version of a
  page. Thus, libxc wrappers and tools need to be updated to recall the share
  functions with the information needed to fetch the page (which they readily
  have).

Tool updates:
The only (in-tree, that we know of) consumer of the mem sharing API is the
memshr tool. This is updated to use the new API.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: use RCU in mem sharing audit list, eliminate global lock completely
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: use RCU in mem sharing audit list, eliminate global lock completely

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agoAdd the ability to poll stats about shared memory via the console
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
Add the ability to poll stats about shared memory via the console

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: New domctl: add a shared page to the physmap
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: New domctl: add a shared page to the physmap

This domctl is useful to, for example, populate parts of a domain's physmap
with shared frames, directly.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Check how many mfns are shared, in addition to how many are saved
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: Check how many mfns are shared, in addition to how many are saved

This patch also moves the existing sharing-related memory op to the
correct location, and adds logic to the audit() method that uses the
new information.

This patch only provides the Xen implementation of the domctls.

Signed-off-by: Andres Lagar-Cavilla <andres@scannell.ca>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Enforce lock ordering for sharing page locks
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: Enforce lock ordering for sharing page locks

Use the ordering constructs in mm-locks.h to enforce an order
for the p2m and page locks in the sharing code. Applies to either
the global sharing lock (in audit mode) or the per page locks.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scanneell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Add per-page locking for memory sharing, when audits are disabled
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: Add per-page locking for memory sharing, when audits are disabled

With the removal of the hash table, all that is needed now is locking
of individual shared pages, as new (gfn,domain) pairs are removed or
added from the list of mappings.

We recycle PGT_locked and use it to lock individual pages. We ensure deadlock
is averted by locking pages in increasing order.

The global lock remains for the benefit of the auditing code, and is
thus enabled only as a compile-time option.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Update mem sharing interface to (re)allow sharing of grants
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: Update mem sharing interface to (re)allow sharing of grants

Previously, the mem sharing code would return an opaque handle to index shared
pages (and nominees) in its global hash table.  By removing the hash table, the
new interfaces requires a gfn and a version. However, when sharing grants, the
caller provides a grant ref and a version. Update interface to handle this
case.

The use case for grant sharing is when sharing from within a backend (e.g.
memshr + blktap2), in which case the backend is only exposed to grant
references.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Committed-by: Tim Deegan <tim@xen.org>
Acked-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Eliminate hash table in sharing code as index of shared mfns
Andres Lagar-Cavilla [Thu, 26 Jan 2012 12:46:26 +0000 (12:46 +0000)]
x86/mm: Eliminate hash table in sharing code as index of shared mfns

Eliminate the sharing hastable mechanism by storing a list head directly in the
page info for the case when the page is shared.  This does not add any extra
space to the page_info and serves to remove significant complexity from
sharing.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agoseabios: update to 1.6.3.1 release
Ian Campbell [Thu, 26 Jan 2012 11:06:40 +0000 (11:06 +0000)]
seabios: update to 1.6.3.1 release

This is the latest seabios stable release.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoREADME: add upstream qemu dependecies
Stefano Stabellini [Thu, 26 Jan 2012 11:06:06 +0000 (11:06 +0000)]
README: add upstream qemu dependecies

Upstream Qemu, just added to the Xen build system, needs GLib 2.0 and
pkg-config to compile.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agotools/libxc: fix error handling in xc_mem_paging_load
Olaf Hering [Thu, 26 Jan 2012 11:04:59 +0000 (11:04 +0000)]
tools/libxc: fix error handling in xc_mem_paging_load

xc_mem_paging_load() does not pass errors in errno and the actual
errno from xc_mem_event_control() is overwritten by munlock().
xenpaging_populate_page() needs to check errno, but with the switch to
xc_mem_paging_load() it could not receive ENOMEM anymore.

Update xc_mem_paging_load() to return -1 and preserve errno during
munlock().

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxenoprof: Make the escape code consistent across 32 and 64-bit xen
George Dunlap [Thu, 26 Jan 2012 11:03:50 +0000 (11:03 +0000)]
xenoprof: Make the escape code consistent across 32 and  64-bit xen

At the moment, the xenoprof escape code is defined as "~0UL".
Unfortunately, this expands to 0xffffffff on 32-bit systems
and 0xffffffffffffffff on 64-bit systems; with the result that
while 32-on-32 and 64-in-64 work fine, 32-on-64 (also known as
"compat mode") is broken.

This patch makes the definition consistent across architectures.
In so doing, it will break old-32-bit-on-new-Xen, and vice versa;
but this was seen as an acceptable thing to do.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxenoprof: Use uint64_t explicitly for internal calls
George Dunlap [Thu, 26 Jan 2012 11:03:23 +0000 (11:03 +0000)]
xenoprof: Use uint64_t explicitly for internal calls

A recent changeset to make XENOPROF_ESCAPE_CODE consistent across
32- and 64-bit builds caused a build failure, because values were
passed through functions as "unsigned long".  Replace these with
uint64_t explicitly.

Also remove redundant function prototype from perfmon.c, now that
it's in a header file.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agodocs: Remove outdated LaTex documentation.
Keir Fraser [Wed, 25 Jan 2012 15:52:47 +0000 (15:52 +0000)]
docs: Remove outdated LaTex documentation.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoSVM: Plumb NPT error-code bits into nested-fault access_X arguments.
Tim Deegan [Tue, 24 Jan 2012 16:46:17 +0000 (16:46 +0000)]
SVM: Plumb NPT error-code bits into nested-fault access_X arguments.

Signed-off-by: Tim Deegan <tim@xen.org>
14 years agolibxl: rename is_assigned to is_pcidev_in_array
Doug Magee [Tue, 24 Jan 2012 15:36:19 +0000 (15:36 +0000)]
libxl: rename is_assigned to is_pcidev_in_array

All this function does is check to see if a device is in an array of
pcidevs passed by the caller.  The function name can be misleading if
ever used to check against a list of devices other than those assigned
to a domain.

Signed-off-by: Doug Magee <djmagee@mageenet.net>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoxl: Add missing trigger for the xl trigger cmd.
Jean Guyader [Tue, 24 Jan 2012 15:33:36 +0000 (15:33 +0000)]
xl: Add missing trigger for the xl trigger cmd.

Add s3resume trigger in the usage of the xl trigger cmd.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: remove _libxl_json_internal.h from libxl_json.h
Ian Campbell [Tue, 24 Jan 2012 15:30:46 +0000 (15:30 +0000)]
libxl: remove _libxl_json_internal.h from libxl_json.h

libxl_json.h is intended as a user-includable header for applications which
would like to use libyajl directly with libxl types. It should not expose libxl
internals.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoupdate MAINTAINERS file
<stefano.stabellini@eu.citrix.com> [Tue, 24 Jan 2012 15:09:32 +0000 (15:09 +0000)]
update MAINTAINERS file

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Add Ian as Seabios maintainer and myself as upstream Qemu maintainer.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
14 years agolibxl: use new qemu at the location where xen-unstable installs it
<stefano.stabellini@eu.citrix.com> [Tue, 24 Jan 2012 15:09:31 +0000 (15:09 +0000)]
libxl: use new qemu at the location where xen-unstable installs it

From: Ian Campbell <ian.campbell@citrix.com>

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoClone and build Seabios by default
<stefano.stabellini@eu.citrix.com> [Tue, 24 Jan 2012 15:09:31 +0000 (15:09 +0000)]
Clone and build Seabios by default

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
14 years agoClone and build upstream Qemu by default
<stefano.stabellini@eu.citrix.com> [Tue, 24 Jan 2012 15:09:30 +0000 (15:09 +0000)]
Clone and build upstream Qemu by default

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agomove the call to xen-setup after libxc and xenstore are built
<stefano.stabellini@eu.citrix.com> [Tue, 24 Jan 2012 15:09:30 +0000 (15:09 +0000)]
move the call to xen-setup after libxc and xenstore are built

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Move the call to xen-setup, the wrapper script to configure
qemu-xen-traditional, right before building qemu-xen-traditional and
after libxc and xenstore are already built.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoRename ioemu-dir as qemu-xen-traditional-dir
<stefano.stabellini@eu.citrix.com> [Tue, 24 Jan 2012 15:09:29 +0000 (15:09 +0000)]
Rename ioemu-dir as qemu-xen-traditional-dir

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoIntroduce git-checkout.sh
<stefano.stabellini@eu.citrix.com> [Tue, 24 Jan 2012 15:09:29 +0000 (15:09 +0000)]
Introduce git-checkout.sh

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Introduce a script to perform git checkout on an external git tree; use
git-checkout.sh in ioemu-dir-find.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoreflect cpupool in numa node affinity
Juergen Gross [Tue, 24 Jan 2012 14:21:12 +0000 (14:21 +0000)]
reflect cpupool in numa node affinity

In order to prefer node local memory for a domain the numa node
locality info must be built according to the cpus belonging to the
cpupool of the domain.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
14 years agoswitch to dynamically allocated cpumask in domain_update_node_affinity()
Juergen Gross [Tue, 24 Jan 2012 14:20:40 +0000 (14:20 +0000)]
switch to dynamically allocated cpumask in domain_update_node_affinity()

cpumasks should rather be allocated dynamically.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
14 years agointroduce and use common macros for selecting cpupool based cpumasks
Juergen Gross [Tue, 24 Jan 2012 14:19:58 +0000 (14:19 +0000)]
introduce and use common macros for selecting cpupool based cpumasks

There are several instances of the same construct finding the cpumask
for a cpupool. Use macros instead.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
14 years agoAdd a GNTTABOP to swap the content of two grant references under lock
Wei Liu [Tue, 24 Jan 2012 14:16:04 +0000 (14:16 +0000)]
Add a GNTTABOP to swap the content of two grant references under lock
provided that they are not currently active.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoRevert 24538:5bb22a6871f6 "xenoprof: Make the escape code consistent across 32 and...
Keir Fraser [Mon, 23 Jan 2012 15:10:43 +0000 (15:10 +0000)]
Revert 24538:5bb22a6871f6 "xenoprof: Make the escape code consistent across 32 and 64-bit xen"

Breaks 32-bit build.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agodecompressors: fix string typo 'bufer'
Paul Bolle [Mon, 23 Jan 2012 13:51:25 +0000 (14:51 +0100)]
decompressors: fix string typo 'bufer'

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
14 years agounlzo: fix input buffer free
Sascha Hauer [Mon, 23 Jan 2012 13:51:02 +0000 (14:51 +0100)]
unlzo: fix input buffer free

unlzo modifies the pointer to in_buf, so we have to free the original
buffer, not the modified pointer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
14 years agolibelf-loader: introduce elf_load_image
Stefano Stabellini [Mon, 23 Jan 2012 09:42:12 +0000 (09:42 +0000)]
libelf-loader: introduce elf_load_image

Implement a new function, called elf_load_image, to perform the
actually copy of the elf image and clearing the padding.  The function
is implemented as memcpy and memset when the library is built as part
of the tools, but it is implemented as raw_copy_to_guest and
raw_clear_guest when built as part of Xen, so that it can be safely
called with an HVM style dom0.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoIntroduce clear_user and clear_guest
Stefano Stabellini [Mon, 23 Jan 2012 09:41:27 +0000 (09:41 +0000)]
Introduce clear_user and clear_guest

Introduce clear_user for x86 and ia64, shamelessly taken from Linux.
The x86 version is the 32 bit clear_user implementation.  Introduce
clear_guest for x86 and ia64. The x86 implementation is based on
clear_user and a new clear_user_hvm function.  The ia64 implementation
is actually in xencomm and it is based on xencomm_copy_to_guest.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxen: implement an signed 64 bit division helper function
Stefano Stabellini [Mon, 23 Jan 2012 09:40:35 +0000 (09:40 +0000)]
xen: implement an signed 64 bit division helper function

Implement a C function to perform 64 bit signed division and return
both quotient and remainder.
Useful as an helper function to implement __aeabi_ldivmod.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoA collection of fixes to Xen common files
Stefano Stabellini [Mon, 23 Jan 2012 09:39:58 +0000 (09:39 +0000)]
A collection of fixes to Xen common files

- call free_xenoprof_pages only ifdef CONFIG_XENOPROF;
- define PRI_stime as PRId64 in an header file;
- respect boundaries in is_kernel_*;
- implement is_kernel_rodata;
- guest_physmap_add_page should be ((void)0).
- fix guest_physmap_add_page;
- introduce CONFIG_XENOPROF;
- define _srodata and _erodata as const char*.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoInclude some header files that are not automatically included on all archs
Stefano Stabellini [Mon, 23 Jan 2012 09:39:11 +0000 (09:39 +0000)]
Include some header files that are not automatically included on all archs

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoMove cpufreq option parsing to cpufreq.c
Stefano Stabellini [Mon, 23 Jan 2012 09:38:34 +0000 (09:38 +0000)]
Move cpufreq option parsing to cpufreq.c

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxenoprof: Make the escape code consistent across 32 and 64-bit xen
George Dunlap [Mon, 23 Jan 2012 09:36:54 +0000 (09:36 +0000)]
xenoprof: Make the escape code consistent across 32 and 64-bit xen

At the moment, the xenoprof escape code is defined as "~0UL".
Unfortunately, this expands to 0xffffffff on 32-bit systems
and 0xffffffffffffffff on 64-bit systems; with the result that
while 32-on-32 and 64-in-64 work fine, 32-on-64 (also known as
"compat mode") is broken.

This patch makes the definition consistent across architectures.
In so doing, it will break old-32-bit-on-new-Xen, and vice versa;
but this was seen as an acceptable thing to do.

Signed-off-by: Marcus Granado <marcus.granado@eu.citrix.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxenoprof: Handle 32-bit guest stacks properly in a 64-bit hypervisor
George Dunlap [Mon, 23 Jan 2012 09:36:29 +0000 (09:36 +0000)]
xenoprof: Handle 32-bit guest stacks properly in a 64-bit hypervisor

The dump_guest_backtrace() function attempted to walk the stack
based on the assumption that the guest and hypervisor pointer sizes
were the same; thus any 32-bit guest running under 64-bit hypervisor
would have unreliable results.

In 64-bit mode, read the 32-bit stack frame properly.

Signed-off-by: Marcus Granado <marcus.granado@eu.citrix.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxenoprof: Adjust indentation
George Dunlap [Mon, 23 Jan 2012 09:36:01 +0000 (09:36 +0000)]
xenoprof: Adjust indentation

Bring indentation into Xen hypervisor standard coding style.

No functional changes.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agox86/vMSI: miscellaneous fixes
Jan Beulich [Mon, 23 Jan 2012 09:35:17 +0000 (09:35 +0000)]
x86/vMSI: miscellaneous fixes

This addresses a number of problems in msixtbl_{read,write}():
- address alignment was not checked, allowing for memory corruption in
  the hypervisor (write case) or returning of hypervisor private data
  to the guest (read case)
- the interrupt mask bit was permitted to be written by the guest
  (while Xen's interrupt flow control routines need to control it)
- MAX_MSIX_TABLE_{ENTRIES,PAGES} were pointlessly defined to plain
  numbers (making it unobvious why they have these values, and making
  the latter non-portable)
- MAX_MSIX_TABLE_PAGES was also off by one (failing to account for a
  non-zero table offset); this was also affecting host MSI-X code
- struct msixtbl_entry's table_flags[] was one element larger than
  necessary due to improper open-coding of BITS_TO_LONGS()
- msixtbl_read() unconditionally accessed the physical table, even
  though the data was only needed in a quarter of all cases
- various calculations were done unnecessarily for both of the rather
  distinct code paths in msixtbl_read()

Additionally it is unclear on what basis MAX_MSIX_ACC_ENTRIES was
chosen to be 3.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agox86/hvm: No need to arch_set_info_guest() before restoring per-vcpu HVM state.
Keir Fraser [Sun, 22 Jan 2012 10:20:03 +0000 (10:20 +0000)]
x86/hvm: No need to arch_set_info_guest() before restoring per-vcpu HVM state.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agotools/libvchan: Beef up the CPU barriers in libvchan.
Keir Fraser [Sat, 21 Jan 2012 17:15:40 +0000 (17:15 +0000)]
tools/libvchan: Beef up the CPU barriers in libvchan.

Although they were sufficient for x86, they weren't safe more generally.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agolibxc: Update rmb/wmb for x86.
Keir Fraser [Sat, 21 Jan 2012 17:14:37 +0000 (17:14 +0000)]
libxc: Update rmb/wmb for x86.

Only the compiler needs to see the barriers; not the CPU.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agolibxl: libxl_qmp.c should use libxl's own list macros, since they
Keir Fraser [Sat, 21 Jan 2012 16:47:00 +0000 (16:47 +0000)]
libxl: libxl_qmp.c should use libxl's own list macros, since they
exist. Also, older Linux versions do not have SIMPLEQ macros in
sys/queue.h.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agox86/hvm: Fix earlier hvm_load_cpu_ctxt() breakage.
Keir Fraser [Fri, 20 Jan 2012 18:17:59 +0000 (18:17 +0000)]
x86/hvm: Fix earlier hvm_load_cpu_ctxt() breakage.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agovpmu: separate architecture specific PMU initialisation
Dietmar Hahn [Fri, 20 Jan 2012 10:40:16 +0000 (10:40 +0000)]
vpmu: separate architecture specific PMU initialisation

This patch moves the architecture specific initialisation of the PMU
into the archicture specific directory.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
14 years agox86/hvm: Remove unnecessary packed attribute from hvm_hw_cpu_xsave struct.
Keir Fraser [Fri, 20 Jan 2012 10:26:57 +0000 (10:26 +0000)]
x86/hvm: Remove unnecessary packed attribute from hvm_hw_cpu_xsave struct.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoiommu: Move IOMMU faults handling into softirq for AMD-Vi.
Dario Faggioli [Fri, 20 Jan 2012 10:20:32 +0000 (10:20 +0000)]
iommu: Move IOMMU faults handling into softirq for AMD-Vi.

Dealing with interrupts from AMD-Vi IOMMU(s) is deferred to a
softirq-tasklet, raised by the actual IRQ handler. To avoid more
interrupts being generated (because of further faults), they must be
masked in the IOMMU within the low level IRQ handler and enabled back
in the tasklet body. Notice that this may cause the log to overflow,
but none of the existing entry will be overwritten.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agox86/hvm: Allow wake up of offline vcpu via nmi-ipi
Juergen Gross [Fri, 20 Jan 2012 10:17:12 +0000 (10:17 +0000)]
x86/hvm: Allow wake up of offline vcpu via nmi-ipi

On a real machine a cpu disabled via hlt with interrupts disabled can
be reactivated via a nmi ipi. Enable the hypervisor to do this for
hvm, too.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxen: Simplify callers of boot_vcpu(). In VCPUOP_up, check
Keir Fraser [Fri, 20 Jan 2012 10:13:55 +0000 (10:13 +0000)]
xen: Simplify callers of boot_vcpu(). In VCPUOP_up, check
is_initialised under the per-domain lock.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agox86/mm: refine epte_present test
Tim Deegan [Thu, 19 Jan 2012 13:09:23 +0000 (13:09 +0000)]
x86/mm: refine epte_present test

The current test for a present ept entry checks for a permission bit
to be set.

While this is valid in contexts in which we want to know whether an entry
will fault, it is not correct when it comes to testing whether an entry is
valid. Specifically, in the ept_change_entry_type_page function which is
used to set entries to the log dirty type.

In combination with a p2m access type like n or n2rwx, log dirty will not be
set for ept entries for which it should.

Reported-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agoCorrect p2m unlocking during grant table map
Andres Lagar-Cavilla [Thu, 19 Jan 2012 10:42:42 +0000 (10:42 +0000)]
Correct p2m unlocking during grant table map

We were not putting gfn's consistently.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Don't ASSERT() for a valid mfn on paged p2m entries in guest_physmap_ad
Andres Lagar-Cavilla [Thu, 19 Jan 2012 10:42:42 +0000 (10:42 +0000)]
x86/mm: Don't ASSERT() for a valid mfn on paged p2m entries in guest_physmap_ad

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Improve ring management for memory events. Do not lose guest events
Andres Lagar-Cavilla [Thu, 19 Jan 2012 10:38:47 +0000 (10:38 +0000)]
x86/mm: Improve ring management for memory events. Do not lose guest events

This patch is an amalgamation of the work done by Olaf Hering <olaf@aepfle.de>
and our work.

It combines logic changes to simplify the memory event API, as well as
leveraging wait queues to deal with extreme conditions in which too many
events are generated by a guest vcpu.

In order to generate a new event, a slot in the ring is claimed. If a
guest vcpu is generating the event and there is no space, it is put on a
wait queue. If a foreign vcpu is generating the event and there is no
space, the vcpu is expected to retry its operation. If an error happens
later, the function returns the claimed slot via a cancel operation.

Thus, the API has only four calls: claim slot, cancel claimed slot, put
request in the ring, consume the response.

With all these mechanisms, no guest events are lost.
Our testing includes 1. ballooning down 512 MiBs; 2. using mem access n2rwx, in
which every page access in a four-vCPU guest results in an event, with no vCPU
pausing, and the four vCPUs touching all RAM. No guest events were lost in
either case, and qemu-dm had no mapping problems.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agoadd NULL checks in code added by 24492:6c104b46ef89
Jan Beulich [Thu, 19 Jan 2012 09:08:12 +0000 (10:08 +0100)]
add NULL checks in code added by 24492:6c104b46ef89

Also a couple of missing is_hvm_domain() checks.

Further properly pass the PCI segment in a call to pci_get_pdev().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
14 years agolibxl: VM generation ID: Add missing gate for HVM domain.
Paul Durrant [Tue, 17 Jan 2012 12:40:52 +0000 (12:40 +0000)]
libxl: VM generation ID: Add missing gate for HVM domain.

This will fix localhost migrate failures found by the automatic tests.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agosched_credit: Use delay to control scheduling frequency
Hui Lv [Tue, 17 Jan 2012 11:18:48 +0000 (11:18 +0000)]
sched_credit: Use delay to control scheduling frequency

This patch can improve Xen performance:
1. Basically, the "delay method" can achieve 11% overall performance
boost for SPECvirt than original credit scheduler.
2. We have tried 1ms delay and 10ms delay, there is no big difference
between these two configurations. (1ms is enough to achieve a good
performance)
3. We have compared different load level response time/latency (low,
high, peak), "delay method" didn't bring very much response time
increase.
4. 1ms delay can reduce 30% context switch at peak performance, where
produces the benefits. (int sched_ratelimit_us = 1000 is the
recommended setting)

Signed-off-by: Hui Lv <hui.lv@intel.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoMove IOMMU faults handling into softirq for VT-d.
Dario Faggioli [Tue, 17 Jan 2012 11:11:26 +0000 (11:11 +0000)]
Move IOMMU faults handling into softirq for VT-d.

Dealing with interrupts from VT-d IOMMU(s) is deferred to a
softirq-tasklet, raised by the actual IRQ handler. Since a new
interrupt is not generated, even if further faults occur, until we
cleared all the pending ones, there's no need of disabling IRQs, as
the hardware does it by its own.  Notice that this may cause the log
to overflow, but none of the existing entry will be overwritten.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agolibxl: drop vfs path -- fsback/front were deleted some time ago
Ian Campbell [Mon, 16 Jan 2012 17:56:07 +0000 (17:56 +0000)]
libxl: drop vfs path -- fsback/front were deleted some time ago

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoocaml: Correct ocaml type name for Aggregate types.
Ian Campbell [Tue, 10 Jan 2012 16:19:09 +0000 (16:19 +0000)]
ocaml: Correct ocaml type name for Aggregate types.

No change to the generated code because this path isn't used yet.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agocleanup get_gfn_from_base_reg() function.
Wei Wang [Mon, 16 Jan 2012 15:36:15 +0000 (16:36 +0100)]
cleanup get_gfn_from_base_reg() function.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
14 years agofix compat header generation after 24503:86b8a1e3a419
Jan Beulich [Mon, 16 Jan 2012 08:55:05 +0000 (09:55 +0100)]
fix compat header generation after 24503:86b8a1e3a419

At once also remove the duplicate forced inclusion of
public/xen-compat.h there (it's already done through cppflags-y) and
convert --include to the canonical -include in said c/s' adjustments
to CFLAGS-y and AFLAGS-y.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
14 years agosedf: remove useless tracing printk and harmonize comments style.
Dario Faggioli [Sun, 15 Jan 2012 22:05:12 +0000 (22:05 +0000)]
sedf: remove useless tracing printk and harmonize comments style.

sched_sedf.c used o have its own mechanism for producing tracing-alike
kind of information (domain block, wakeup, etc.). Nowadays, with an
even not so high number of pCPUs/vCPUs, just trying to enable this
makes the serial console completely unusable, produces tons of very
hard to parse and interpreet logging and can easily livelock
Dom0. Moreover, pretty much the same result this is struggling to get
to, is better achieved by enabling the scheduler-related tracing
events, as it is for the other schedulers (say, credit or credit2).

For all these reasons, this removes that machinery completely. While
at it, check in some cosmetics that harmonize the comments withim
themself and with the rest of the code base.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
14 years agox86: Make asmlinkage explicitly a no-op, and avoid usage in arch/x86
Keir Fraser [Sun, 15 Jan 2012 22:02:35 +0000 (22:02 +0000)]
x86: Make asmlinkage explicitly a no-op, and avoid usage in arch/x86

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agolibxl: Fix leaks on context init failure
Ian Jackson [Fri, 13 Jan 2012 16:54:27 +0000 (16:54 +0000)]
libxl: Fix leaks on context init failure

Several of the error exits from libxl_ctx_alloc leaked the context
struct itself and sometimes other resources too.

Fix this by using the standard "rc = ERROR_FOO; goto out" error
handling style throughout.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: Provide more formal libxl__ctx_lock and _unlock
Ian Jackson [Fri, 13 Jan 2012 16:54:27 +0000 (16:54 +0000)]
libxl: Provide more formal libxl__ctx_lock and _unlock

Previously the only official interface for the ctx lock was the
CTX_LOCK and CTX_UNLOCK convenience macros, which assume and use "ctx"
from the surrounding scope.

Instead, provide libxl__ctx_lock and _unlock functions which can be
used by these convenience macros, and other callers who have
nonstandard requirements.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: move a lot more includes into libxl_internal.h
Ian Jackson [Fri, 13 Jan 2012 16:54:19 +0000 (16:54 +0000)]
libxl: move a lot more includes into libxl_internal.h

Move a lot of
  #include <stdfoo.h>
from individual files into libxl_internal.h.  This helps avoid
portability mistakes where necessary system headers are omitted from
individual files, and is also of course a convenience when developing.

Also add
  #include "libxl_osdeps.h" /* must come before any other headers */
to the top of most libxl*.c files, so that anyone who adds any headers
before libxl_internal.h will put the in the right place.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agoxenstore: New function xs_path_is_subpath
Ian Jackson [Fri, 13 Jan 2012 16:54:11 +0000 (16:54 +0000)]
xenstore: New function xs_path_is_subpath

This utility function compares two paths, textually and reports
whether one is a subpath (a child path) of the other.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agolibxl: make LIBXL_INIT_GC a statement, not an initialiser
Ian Jackson [Fri, 13 Jan 2012 16:54:11 +0000 (16:54 +0000)]
libxl: make LIBXL_INIT_GC a statement, not an initialiser

Previously LIBXL_INIT_GC was an initialiser, which you were expected
to use like this:
    libxl__gc gc = LIBXL_INIT_GC(ctx);

But we are going to want to put things in the gc which are to be
initialised using other macros.  That means that LIBXL_INIT_GC has to
become a statement too.  So instead, we make it so that it's used like this:
    libxl_gc gc;
    LIBXL_INIT_GC(gc,ctx);

In fact there are only a couple of callers now,
including GC_INIT which uses this trick:
    libxl_gc gc[1];
    LIBXL_INIT_GC(gc[0],ctx);

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years ago.gitignore: ocaml: add xenlight.mli
Ian Jackson [Fri, 13 Jan 2012 16:54:09 +0000 (16:54 +0000)]
.gitignore: ocaml: add xenlight.mli

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
14 years agoremove inclusion of asm/config.h
Jan Beulich [Fri, 13 Jan 2012 07:34:57 +0000 (08:34 +0100)]
remove inclusion of asm/config.h

This was always bogus (xen/config.h should have been used instead) and
is superfluous now that xen/config.h gets included through the compiler
command line.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoforce inclusion of xen/config.h through compiler option
Jan Beulich [Fri, 13 Jan 2012 07:33:31 +0000 (08:33 +0100)]
force inclusion of xen/config.h through compiler option

As we expect all source files to include the header as the first thing
anyway, stop doing this by repeating the inclusion in each and every
source file (and in many headers), but rather enforce this uniformly
through the compiler command line.

As a first cleanup step, remove the explicit inclusion from all common
headers. Further cleanup can be done incrementally.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agolibxl: fix build with make prior to 3.81
Jan Beulich [Thu, 12 Jan 2012 17:51:11 +0000 (17:51 +0000)]
libxl: fix build with make prior to 3.81

Up to 3.80, make only supported simple 'else' constructs, which got
violated by 24432:e0effa7c04f5.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years ago.gitignore
Ian Jackson [Thu, 12 Jan 2012 16:45:21 +0000 (16:45 +0000)]
.gitignore

Introduce a .gitignore file for the convenience of people who use git.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agox86/mm: Fix operator associativity bug in mm-locks.h
Tim Deegan [Thu, 12 Jan 2012 16:39:05 +0000 (16:39 +0000)]
x86/mm: Fix operator associativity bug in mm-locks.h

In an order-enforcing wrapper for an "external" recursive lock,
we aim to increment/decrement a recurse count and only update the
lock ordering on zero counts.

Unfortunately we incrementing/decrementing the pointer to the
recurse count, rather than the count itself.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86-64: globally use -mno-sse
Jan Beulich [Thu, 12 Jan 2012 15:46:54 +0000 (16:46 +0100)]
x86-64: globally use -mno-sse

This eliminates pointless prologue code from functions having variable
argument lists (since that way xmm registers can't possibly be passed).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>